package com.zhang.zxx.easyexcel.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.OnceAbsoluteMerge;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;


/**
 * DemoMergeData:合并单元格
 * 说明:@OnceAbsoluteMerge: 指定从哪一行开始，哪一行结束，哪一列开始，哪一列结束，进行合并单元格
 * firstRowIndex   : 起始行索引 从0开始
 * lastRowIndex    : 结束行索引
 * firstColumnIndex: 起始列索引 从0开始
 * lastColumnIndex : 结束列索引
 * 例如: 第2-3行,2-3列进行合并
 *
 * @author zhangxiaoxiang
 * @date 2021/1/13
 */
@OnceAbsoluteMerge(firstRowIndex = 1, lastRowIndex = 2, firstColumnIndex = 1, lastColumnIndex = 2)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DemoMergeData {
    /**
     * 每隔两行合并一次(竖着合并单元格)
     * :@ContentLoopMerge(eachRow = 2)
     */
    @ExcelProperty("字符串标题")
    private String string;
    /**
     * 日期标题
     */
    @ExcelProperty("日期标题")
    private Date date;
    /**
     * 数字标题
     */
    @ExcelProperty("数字标题")
    private Double doubleData;
}